stack: respect gtk-enable-animations setting
authorMatthias Clasen <mclasen@redhat.com>
Tue, 19 Nov 2013 04:19:27 +0000 (23:19 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 19 Nov 2013 04:19:27 +0000 (23:19 -0500)
https://bugzilla.gnome.org/show_bug.cgi?id=712632

gtk/gtkstack.c

index 1f0da9e3d41d24ef9b500e875428a13ac3ffc5ba..a284a66bbc7eb79f02e798bb2aa818f8c13fa3a2 100644 (file)
@@ -45,6 +45,9 @@
  * These animations respect the #GtkSettings::gtk-enable-animations
  * setting.
  *
+ * These animations respect the #GtkSettings::gtk-enable-animations
+ * setting.
+ *    
  * The GtkStack widget was added in GTK+ 3.10.
  */
 
@@ -827,6 +830,14 @@ static GtkStackTransitionType
 effective_transition_type (GtkStack               *stack,
                            GtkStackTransitionType  transition_type)
 {
+  gboolean animations_enabled;
+
+  g_object_get (gtk_widget_get_settings (GTK_WIDGET (stack)),
+                "gtk-enable-animations", &animations_enabled,
+                NULL);
+  if (!animations_enabled)
+    return GTK_STACK_TRANSITION_TYPE_NONE;
+
   if (gtk_widget_get_direction (GTK_WIDGET (stack)) == GTK_TEXT_DIR_RTL)
     {
       if (transition_type == GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT)